* (bug 52587) Maintenance script deleteBatch.php no longer follows redirects
in the file namespace and delete the file on the target page. It will still
however delete the redirect page.
+* (bug 22683) {{msgnw:}} and other uses of PPFrame::RECOVER_ORIG will correctly
+ recover the original code of extension tags.
=== Web API changes in 1.24 ===
* action=parse API now supports prop=modules, which provides the list of
const STRIP_COMMENTS = 4;
const NO_IGNORE = 8;
const RECOVER_COMMENTS = 16;
+ const NO_TAGS = 32;
- const RECOVER_ORIG = 27; // = 1|2|8|16 no constant expression support in PHP yet
+ const RECOVER_ORIG = 59; // = 1|2|8|16|32 no constant expression support in PHP yet
/** This constant exists when $indexOffset is supported in newChild() */
const SUPPORTS_INDEX_OFFSET = 1;
$attrs = $xpath->query( 'attr', $contextNode );
$inners = $xpath->query( 'inner', $contextNode );
$closes = $xpath->query( 'close', $contextNode );
- $params = array(
- 'name' => new PPNode_DOM( $names->item( 0 ) ),
- 'attr' => $attrs->length > 0 ? new PPNode_DOM( $attrs->item( 0 ) ) : null,
- 'inner' => $inners->length > 0 ? new PPNode_DOM( $inners->item( 0 ) ) : null,
- 'close' => $closes->length > 0 ? new PPNode_DOM( $closes->item( 0 ) ) : null,
- );
- $out .= $this->parser->extensionSubstitution( $params, $this );
+ if ( $flags & PPFrame::NO_TAGS ) {
+ $s = '<' . $this->expand( $names->item( 0 ), $flags );
+ if ( $attrs->length > 0 ) {
+ $s .= $this->expand( $attrs->item( 0 ), $flags );
+ }
+ if ( $inners->length > 0 ) {
+ $s .= '>' . $this->expand( $inners->item( 0 ), $flags );
+ if ( $closes->length > 0 ) {
+ $s .= $this->expand( $closes->item( 0 ), $flags );
+ }
+ } else {
+ $s .= '/>';
+ }
+ $out .= $s;
+ } else {
+ $params = array(
+ 'name' => new PPNode_DOM( $names->item( 0 ) ),
+ 'attr' => $attrs->length > 0 ? new PPNode_DOM( $attrs->item( 0 ) ) : null,
+ 'inner' => $inners->length > 0 ? new PPNode_DOM( $inners->item( 0 ) ) : null,
+ 'close' => $closes->length > 0 ? new PPNode_DOM( $closes->item( 0 ) ) : null,
+ );
+ $out .= $this->parser->extensionSubstitution( $params, $this );
+ }
} elseif ( $contextNode->nodeName == 'h' ) {
# Heading
$s = $this->expand( $contextNode->childNodes, $flags );
} elseif ( $contextNode->name == 'ext' ) {
# Extension tag
$bits = $contextNode->splitExt() + array( 'attr' => null, 'inner' => null, 'close' => null );
- $out .= $this->parser->extensionSubstitution( $bits, $this );
+ if ( $flags & PPFrame::NO_TAGS ) {
+ $s = '<' . $bits['name']->firstChild->value;
+ if ( $bits['attr'] ) {
+ $s .= $bits['attr']->firstChild->value;
+ }
+ if ( $bits['inner'] ) {
+ $s .= '>' . $bits['inner']->firstChild->value;
+ if ( $bits['close'] ) {
+ $s .= $bits['close']->firstChild->value;
+ }
+ } else {
+ $s .= '/>';
+ }
+ $out .= $s;
+ } else {
+ $out .= $this->parser->extensionSubstitution( $bits, $this );
+ }
} elseif ( $contextNode->name == 'h' ) {
# Heading
if ( $this->parser->ot['html'] ) {
* interpreted
but rather passed unmodified
{{test}}
+<gallery>
+File:Foobar.jpg
+</gallery>
!! endarticle
# hmm, fix this or just deprecate msgnw and document its behavior?
!! test
msgnw keyword
-!! options
-disabled
!! wikitext
{{msgnw:MSGNW test}}
!! html
-<p>''None'' of '''this''' should be
-* interpreted
- but rather passed unmodified
-{{test}}
+<p>''None'' of '''this''' should be
+* interpreted
+ but rather passed unmodified
+{{test}}
+<gallery>
+File:Foobar.jpg
+</gallery>
</p>
!! end